package file;

import java.io.File;
import java.util.Arrays;

public class Demo4 {
    public static void main(String[] args) {
        //针对文件无法list（）
//        File file = new File("./test.txt");
        File file = new File("D:/");
        String[] list = file.list();
        System.out.println(Arrays.toString(list));

        File[] files = file.listFiles();
        System.out.println(Arrays.toString(files));
    }
}
